package com.example.demo.plugin;

import com.example.demo.domain.Bot;
import com.example.demo.domain.BotPlugin;
import com.example.demo.event.GroupMessageEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import static com.example.demo.config.MessageConfig.MESSAGE_BLANK;
import static com.example.demo.config.MessageConfig.MESSAGE_IN;

/**
 * TODO
 *
 * @author bystart
 * @version 1.0
 * @date 2021/10/21 10:10 上午
 */
@Slf4j
@Component
public class GirlPlugin extends BotPlugin {

    @Override
    public int onGroupMessage(Bot bot, GroupMessageEvent event) {
        String message = event.getMessage();
        if (message.equals("美女图")){
            bot.sendImageMessage(event.getGroupId(), "https://yuanxiapi.cn/api/Littlesister");
            return MESSAGE_BLANK;
        }
        if (message.equals("cos")){
            bot.sendImageMessage(event.getGroupId(), "https://imgapi.cn/cos.php");
            return MESSAGE_BLANK;
        }
        if (message.equals("性感图")){
            bot.sendImageMessage(event.getGroupId(), "http://img.btu.pp.ua/random/api.php");
            return MESSAGE_BLANK;
        }
        if (message.equals("妹子图")){
            bot.sendImageMessage(event.getGroupId(), "https://imgapi.cn/api.php?zd=mobile&fl=meizi&gs=images");
            return MESSAGE_BLANK;
        }
        return MESSAGE_IN;
    }
}
